package com.example.administrator.jingpingou.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.MediaController;

import com.example.administrator.jingpingou.R;

import java.util.List;

/**
 * Created by 小吧 on 2016/8/29.
 */
public class StageAdapter extends RecyclerView.Adapter<StageAdapter.MyViewHolder> {
    private List<String> mData;
    private Context mContext;
    public StageAdapter(List<String> data,Context context){
        mData = data;
        mContext = context;
    }
    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = View.inflate(mContext, R.layout.item_shop_main,null);
        MyViewHolder holder = new MyViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        holder.mButton.setText(mData.get(position));
    }

    @Override
    public int getItemCount() {
        return mData==null?0:mData.size();
    }

    public class MyViewHolder extends RecyclerView.ViewHolder{
        private Button mButton;
        public MyViewHolder(View itemView) {
            super(itemView);
            mButton = (Button) itemView.findViewById(R.id.bt_item_shop_main);
        }
    }
}
